package com.example.demo.entity.m;

import com.example.demo.entity.User;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;

/**
 * Created by xiabin on 2017/7/18.
 */
@Entity
public class UserProfile {
    @Column(nullable = false)
    private String nickname;
    @Column()
    private Date birthday;
    @Column(nullable = false)
    private Short sex;
    @Column
    private int age;
    @Column
    private String email;
    @Column(nullable = false)
    private String phone;
    @Column
    private String sign;
    @Column(nullable = false)
    private String avator;
    @Column(nullable = false)
    private int userId;

    @Id
    @GeneratedValue
    private int proId;

    public static UserProfile genUserProfilequick(User u, Short sex, String phone, String avator) {
        UserProfile profile = new UserProfile();
        profile.setUserId(u.getId());
        profile.setNickname(u.getName());
        profile.setSex(sex);
        profile.setPhone(phone);
        profile.setAvator(avator);
        return profile;
    }

    public int getProId() {
        return proId;
    }

    public void setProId(int proId) {
        this.proId = proId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Short getSex() {
        return sex;
    }

    public void setSex(Short sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getAvator() {
        return avator;
    }

    public void setAvator(String avator) {
        this.avator = avator;
    }
}
